{include file="common/head"}
<head>
	<style>
		div{border: 0 solid #ccc;}
		#top{height: 90px;padding:0 10px;}
		#content{min-height: 700px;}
		.top_menu{font-style: bold;background-color: ;cursor: pointer;}
		.second_menu{padding-left:30px;cursor: pointer;}
		.menu_active{color: #006;font-weight: bold;background-color: #f7f7f7;}
		a{text-decoration: none;}
		#bottom{text-align: center;}
		#msg_count{position: absolute;top:0;right:0;background: red;color:#fff;border-radius: 50%;width:24px;height:24px;text-align: center;line-height: 24px;}
	</style>
</head>
<body style="background-image: url({$sys.background_image});">
	<div class="container-fluid" >
		<div id="top" class="row">
			<div class="col-1"><image src="/upload/logo.png" class="logo" style="height:86px;left:10px;" /></div>
			<div class="col-8" style="text-align: left;">
				<h1 class="text-primary" style="line-height: 85px;"><c style="color:green;">{$sys.sys_name} {$dept.name}</c>  </h1>
			</div>
			<div class="col-3 text-center">
		 		<div style="font-size: larger;line-height: 85px;position: relative;">
					<c><span class="bi-person-circle"></span>{$uname}</c>&nbsp;
					<c><span class="bi-box-arrow-right"></span><a href="/index.php/login/logout/target/admin">退出系统</a></span>&nbsp;
					<c><span class="bi-list-task"></span><a href="#" id="show_menu">隐藏菜单</a></c>
				</div> 				
			</div>


		</div>

		<div style="height: 100px;"></div>
		<div id="content" class="row">
			<div id="left" class="col" style="max-width:240px;">
				<ul class="list-group list-group-flush">
					{foreach $menu as $val}
				  	<li class="list-group-item {$val.class} fid_{$val['fid']}" url="{$val['url_key']}" menu_id="{$val['id']}" >
				  		{if $val['url_key']=='msg/index'}<div id="msg_count">0</div>{/if}
				  		<span class="{$val['icon']}"></span>
				  		{if $val['url_key']}
				  			<a href="/index.php/{$val['url_key']}" target="to">{$val.name}</a>
				  		{else}
							{$val.name}
				  		{/if}
				  	</li>
					{/foreach}
				</ul>

			</div>
			
			<div id="right" class="col">

				<iframe src="" frameborder="0" name="to" style="border: 1px solid #ccc;width:100%;height:100%;"></iframe>

			</div>

		</div>
		<div style="height: 60px;"></div>
		<div id="bottom">
			版权所有：xjpa666.cn
			<c class="text-info">{$sys.copy_right}</c> 
			<a href="https://beian.miit.gov.cn/">浙ICP备2023021152号-1</a>  
			技术支持：浙江万溢信息科技有限公司
		</div>
	</div>
	

<script type="text/javascript">


 
	$(document).ready(function(){

		function ajax_breath(){
			$.post('/index.php/admin/ajax_breath',function(res){
				console.log(res);
			});
		}

		function msgs(){
			$.post('/index.php/msg/msg_count',function(res){
				console.log(res);
				if(res.count>0){
					$("#msg_count").text(res.count);
				}
			});
		}

		setInterval(msgs,10000);

		$("#show_menu").on('click',function(){
			if($(this).html()=='隐藏菜单'){
				$(this).html('显示菜单');
			}else{
				$(this).html('隐藏菜单');
			}
			$("#left").toggle('fast');
		})

		//左侧菜单处理
		$(".top_menu").addClass('list-group-item-primary').on('click',function(e){
			var fid=$(this).attr('menu_id');
			$(".fid_"+fid).toggle(100);
		});
		//菜单事件
		$(".second_menu").on('click',function(e){
			$(".second_menu").removeClass("menu_active");
			$(this).toggleClass("menu_active");
		});
		//动态组件的事件
		$("#table_list").on('click',".edit",function(e){
			window.location.href=$(this).attr('url');
		})

		$("iframe").attr('src','/index.php/admin/home');

	});
</script>
</body>
</html>